.container {
    padding: 20px 0 40px;
}
// 自动打字
.demo1 {
    margin: 0 auto;
    overflow: hidden;
    border-right: 2px solid transparent;
    width: calc(18 * 31px + 2px);
    animation: typing 9s steps(18) infinite, caret 0.5s steps(1) infinite;
    font-weight: bold;
    font-size: 30px;
    white-space: nowrap;
    color: var(--el-color-primary);
    letter-spacing: 1px;
}
@keyframes typing {
    from {
        width: 2px;
    }
}
@keyframes caret {
    50% {
        border-right-color: currentColor;
    }
}
// 霓虹文字
.demo2 {
    margin: 20px auto 0;
    width: 400px;
    background: #1a2327;
    color: #999;
    font-size: 70px;
    font-weight: bold;
    text-align: center;
    &:hover {
        span {
            animation: flicker 1s linear forwards;
            &:nth-child(2) {
                animation-delay: 0.2s;
            }
            &:nth-child(3) {
                animation-delay: 0.5s;
            }
            &:nth-child(4) {
                animation-delay: 0.6s;
            }
        }
    }
}
@keyframes flicker {
    0% {
        color: #333;
    }
    10%,
    20% {
        color: #333;
        text-shadow: none;
    }
    5%,
    15%,
    25%,
    30%,
    100% {
        color: #fff;
        text-shadow: 0px 0px 5px #42fff6, 0px 0px 10px #42fff6, 0px 0px 20px #42fff6,
            0px 0px 50px #42fff6;
    }
}
// 背景文字
.demo3 {
    margin: 20px auto 0;
    width: 500px;
    height: 200px;
    text-align: center;
    font-weight: bold;
    color: transparent;
    // 自定义图
    background: url(./images/game.jpg) no-repeat center / cover;
    // 渐变图
    // background: linear-gradient(45deg, #ffeb3b, yellowgreen, #03a9f4, #9c27b0);
    background-clip: text;

    &>div:nth-child(1) {
        font-size: 70px;
    }
    &>div:nth-child(2) {
        font-size: 100px;
        line-height: 100px;
        // letter-spacing: 10px;
    }
}
// 高亮文字
.demo4 {
    position: relative;
    margin: 20px auto 0;
    width: 700px;
    height: 100px;
    background: #1a2327;
    text-align: center;
    font-weight: bold;
    font-size: 70px;
    color: #E8A95B;
    
    &::after {
        content: attr(data-text);
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        color: transparent;
        background-image: linear-gradient(120deg, 
            transparent 0%, transparent 10%, 
            rgba(255, 255, 255, 0.7) 15%, 
            transparent 18%, transparent 50%, 
            rgba(255, 255, 255, 0.6) 60%, 
            transparent 65%, transparent 100% );
        background-size: 200%;
        background-position: 0% 0;
        background-clip: text;
        animation: shine 4s infinite linear;
    }
}
@keyframes shine {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}
// 镂空文字
.demo5 {
    margin: 20px auto 0;
    width: 500px;
    background: linear-gradient(#E8A95B 0 100%) left / 0 no-repeat;
    -webkit-text-stroke: 2px #E8A95B;
    background-clip: text;
    color: transparent;
    transition: 0.8s linear;
    font-weight: bold;
    text-align: center;

    &:hover {
        background-size: 100%;
    }
    &>div:nth-child(1) {
        font-size: 70px;
    }
    &>div:nth-child(2) {
        font-size: 100px;
        line-height: 110px;
    }
}
// 融合文字
.demo6 {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto 0;
    background: black;
    width: 850px;
    height: 120px;
    &>div {
        width: 800px;
        height: 90px;
        line-height: 80px;
        font-size: 60px;
        font-weight: bold;
        color: white;
        background: black;
        text-align: center;
        animation: move 5s infinite alternate ease-in-out;
    }
}

@keyframes move {
    0%, 5% {
        letter-spacing: -60px;
        filter: blur(7px) contrast(20);
    }
    70%, 100% {
        letter-spacing: 10px;
        filter: none;
    }
}
